
#include <malloc.h>
#include <string.h>
#include "Framework.h"

/* constructor */
TFW_Stream::TFW_Stream(){}
TFW_Stream::~TFW_Stream()
{
	if(NULL != m_buf)
	{
		delete m_buf;
		m_buf = NULL;
	}
}

/* temporary job */
void TFW_Stream::setbuf(char* var)
{
	size_t len = strlen(var);
	m_buf = (char*)malloc(len + 1);
	memset(m_buf, 0x00, sizeof(m_buf));
	
	memcpy(m_buf, var, strlen(var));
	m_len = sizeof(m_buf);
}

char* TFW_Stream::getbuf()
{
	return m_buf;
}

int TFW_Stream::getlen()
{
	return m_len;
}
